package com.itheima.leetcode.od.c.string;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.stream.Collectors;

/**
 * <h3>密码输入检测</h3>
 */
public class PasswordInputDetection {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();

        LinkedList<Character> stack = new LinkedList<>();

        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);

            if (c == '<') {
                if (stack.isEmpty()) {
                    continue;
                }
                stack.pop();
            } else {
                stack.push(c);
            }
        }

        int upper = 0;
        int lower = 0;
        int number = 0;
        int non_letter_number = 0;

        ArrayList<String> password = new ArrayList<>();
        for (Character c : stack) {
            password.add(String.valueOf(c));

            if (c >= 'a' && c <= 'z') {
                lower++;
            } else if (c >= 'A' && c <= 'Z') {
                upper++;
            } else if (c >= '0' && c <= '9') {
                number++;
            } else {
                non_letter_number++;
            }
        }

        if (password.size() >= 8
                && lower >= 1
                && upper >= 1
                && number >= 1
                && non_letter_number >= 1) {
            password.add("true");
        } else {
            password.add("false");
        }

        System.out.println(password.stream().collect(Collectors.joining(",")));
    }
}